package util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Encoded {
	public static String getSHA1(String input) {
		try {
		MessageDigest md = MessageDigest.getInstance("SHA-1");
		byte[] messageDigest = md.digest(input.getBytes());
		BigInteger number = new BigInteger(1, messageDigest);
		String hashtext = number.toString(16);
		while (hashtext.length() < 40) {
		hashtext = "0" + hashtext;
		}
		return hashtext;
		}
		catch (NoSuchAlgorithmException e) {
		throw new RuntimeException(e);
		}
		}

}
